package c.c.c.a;

import android.app.ActivityManager;
import android.app.Application;
import android.content.ComponentName;
import android.content.Context;
import android.os.Build;
import android.os.Build.VERSION;
import android.os.Debug;
import android.os.Debug.MemoryInfo;
import android.text.TextUtils;
import c.c.c.a.i.j;
import com.bytedance.tea.crash.upload.CrashUploadService;
import java.io.PrintWriter;
import java.lang.reflect.Field;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;
import org.json.JSONException;
import org.json.JSONObject;

/* compiled from: Npth */
public final class m {
    public static boolean a;

    /* compiled from: Npth */
    public static class a implements Runnable {
        public final /* synthetic */ Context a;
        public final /* synthetic */ boolean b;

        public a(Context context, boolean z) {
            this.a = context;
            this.b = z;
        }

        /* JADX WARNING: Missing block: B:3:0x001b, code skipped:
            if (c.c.c.a.m.b.f(c.c.c.a.n.c.a).equals(r0.getPackageName()) == false) goto L_0x002c;
     */
        public void run() {
            /*
            r5 = this;
            r0 = c.c.c.a.c.b.a();
            r1 = r5.a;
            r0.b(r1);
            r0 = r5.a;
            r1 = c.c.c.a.n.c;	 Catch:{ Exception -> 0x001e }
            r1 = r1.a;	 Catch:{ Exception -> 0x001e }
            r1 = c.c.c.a.m.b.f(r1);	 Catch:{ Exception -> 0x001e }
            r2 = r0.getPackageName();	 Catch:{ Exception -> 0x001e }
            r1 = r1.equals(r2);	 Catch:{ Exception -> 0x001e }
            if (r1 != 0) goto L_0x001e;
        L_0x001d:
            goto L_0x002c;
        L_0x001e:
            r1 = c.c.c.a.i.j.b();
            r2 = new c.c.c.a.o.c;
            r2.m1099init(r0);
            r0 = 0;
            r3 = (long) r0;
            r1.postDelayed(r2, r3);
        L_0x002c:
            r0 = r5.b;
            if (r0 == 0) goto L_0x005a;
        L_0x0030:
            r0 = r5.a;
            r1 = c.c.c.a.a.d.b;
            if (r1 != 0) goto L_0x0049;
        L_0x0036:
            r1 = c.c.c.a.a.d.class;
            monitor-enter(r1);
            r2 = c.c.c.a.a.d.b;	 Catch:{ all -> 0x0046 }
            if (r2 != 0) goto L_0x0044;
        L_0x003d:
            r2 = new c.c.c.a.a.d;	 Catch:{ all -> 0x0046 }
            r2.m1047init(r0);	 Catch:{ all -> 0x0046 }
            c.c.c.a.a.d.b = r2;	 Catch:{ all -> 0x0046 }
        L_0x0044:
            monitor-exit(r1);	 Catch:{ all -> 0x0046 }
            goto L_0x0049;
        L_0x0046:
            r0 = move-exception;
            monitor-exit(r1);	 Catch:{ all -> 0x0046 }
            throw r0;
        L_0x0049:
            r0 = c.c.c.a.a.d.b;
            r0 = r0.a;
            r1 = r0.c;
            if (r1 == 0) goto L_0x0052;
        L_0x0051:
            goto L_0x005a;
        L_0x0052:
            r1 = new c.c.c.a.a.b;
            r1.m1046init(r0);
            r1 = 1;
            r0.c = r1;
        L_0x005a:
            return;
            */
            throw new UnsupportedOperationException("Method not decompiled: c.c.c.a.m$a.run():void");
        }
    }

    /* compiled from: App */
    public final class b {
        public static String a = null;
        public static String b = null;
        public static Class<?> c = null;
        public static Field d = null;
        public static Field e = null;
        public static boolean f = false;

        public static long a(int i) {
            return i < 0 ? 0 : ((long) i) * 1024;
        }

        public static void b(JSONObject jSONObject) throws JSONException {
            MemoryInfo memoryInfo = new MemoryInfo();
            Debug.getMemoryInfo(memoryInfo);
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("dalvikPrivateDirty", a(memoryInfo.dalvikPrivateDirty));
            jSONObject2.put("dalvikPss", a(memoryInfo.dalvikPss));
            jSONObject2.put("dalvikSharedDirty", a(memoryInfo.dalvikSharedDirty));
            jSONObject2.put("nativePrivateDirty", a(memoryInfo.nativePrivateDirty));
            jSONObject2.put("nativePss", a(memoryInfo.nativePss));
            jSONObject2.put("nativeSharedDirty", a(memoryInfo.nativeSharedDirty));
            jSONObject2.put("otherPrivateDirty", a(memoryInfo.otherPrivateDirty));
            jSONObject2.put("otherPss", a(memoryInfo.otherPss));
            jSONObject2.put("otherSharedDirty", memoryInfo.otherSharedDirty);
            jSONObject2.put("totalPrivateClean", memoryInfo.getTotalPrivateClean());
            jSONObject2.put("totalPrivateDirty", memoryInfo.getTotalPrivateDirty());
            jSONObject2.put("totalPss", a(memoryInfo.getTotalPss()));
            jSONObject2.put("totalSharedClean", memoryInfo.getTotalSharedClean());
            jSONObject2.put("totalSharedDirty", a(memoryInfo.getTotalSharedDirty()));
            jSONObject2.put("totalSwappablePss", a(memoryInfo.getTotalSwappablePss()));
            jSONObject.put("memory_info", jSONObject2);
        }

        public static void c(JSONObject jSONObject, ActivityManager activityManager) throws JSONException {
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("native_heap_size", Debug.getNativeHeapSize());
            jSONObject2.put("native_heap_alloc_size", Debug.getNativeHeapAllocatedSize());
            jSONObject2.put("native_heap_free_size", Debug.getNativeHeapFreeSize());
            Runtime runtime = Runtime.getRuntime();
            jSONObject2.put("max_memory", runtime.maxMemory());
            jSONObject2.put("free_memory", runtime.freeMemory());
            jSONObject2.put("total_memory", runtime.totalMemory());
            if (activityManager != null) {
                jSONObject2.put("memory_class", activityManager.getMemoryClass());
                jSONObject2.put("large_memory_class", activityManager.getLargeMemoryClass());
            }
            jSONObject.put("app_memory_info", jSONObject2);
        }

        public static void d(JSONObject jSONObject, ActivityManager activityManager) throws JSONException {
            JSONObject jSONObject2 = new JSONObject();
            ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();
            activityManager.getMemoryInfo(memoryInfo);
            jSONObject2.put("availMem", memoryInfo.availMem);
            jSONObject2.put("lowMemory", memoryInfo.lowMemory);
            jSONObject2.put("threshold", memoryInfo.threshold);
            jSONObject2.put("totalMem", memoryInfo.totalMem);
            jSONObject.put("sys_memory_info", jSONObject2);
        }

        public static boolean e(Context context) {
            String f = f(context);
            if (b == null) {
                try {
                    String str = context.getPackageManager().getServiceInfo(new ComponentName(context, CrashUploadService.class), 65536).processName;
                    b = str;
                    b = str.substring(str.lastIndexOf(":"));
                } catch (Throwable th) {
                    th.printStackTrace();
                    b = ":npth";
                }
            }
            return f != null && f.endsWith(b);
        }

        /* JADX WARNING: Removed duplicated region for block: B:31:0x0081 A:{Catch:{ all -> 0x007c, all -> 0x0084 }} */
        /* JADX WARNING: Removed duplicated region for block: B:35:0x0088  */
        public static java.lang.String f(android.content.Context r5) {
            /*
            r0 = a;
            r1 = android.text.TextUtils.isEmpty(r0);
            if (r1 != 0) goto L_0x0009;
        L_0x0008:
            return r0;
        L_0x0009:
            r0 = android.os.Process.myPid();	 Catch:{ all -> 0x0034 }
            r1 = "activity";
            r5 = r5.getSystemService(r1);	 Catch:{ all -> 0x0034 }
            r5 = (android.app.ActivityManager) r5;	 Catch:{ all -> 0x0034 }
            if (r5 == 0) goto L_0x0038;
        L_0x0017:
            r5 = r5.getRunningAppProcesses();	 Catch:{ all -> 0x0034 }
            r5 = r5.iterator();	 Catch:{ all -> 0x0034 }
        L_0x001f:
            r1 = r5.hasNext();	 Catch:{ all -> 0x0034 }
            if (r1 == 0) goto L_0x0038;
        L_0x0025:
            r1 = r5.next();	 Catch:{ all -> 0x0034 }
            r1 = (android.app.ActivityManager.RunningAppProcessInfo) r1;	 Catch:{ all -> 0x0034 }
            r2 = r1.pid;	 Catch:{ all -> 0x0034 }
            if (r2 != r0) goto L_0x001f;
        L_0x002f:
            r5 = r1.processName;	 Catch:{ all -> 0x0034 }
            a = r5;	 Catch:{ all -> 0x0034 }
            return r5;
        L_0x0034:
            r5 = c.c.c.a.n.a;
            r5 = c.c.c.a.n.d;
        L_0x0038:
            r5 = 0;
            r0 = new java.io.BufferedReader;	 Catch:{ all -> 0x007e }
            r1 = new java.io.InputStreamReader;	 Catch:{ all -> 0x007e }
            r2 = new java.io.FileInputStream;	 Catch:{ all -> 0x007e }
            r3 = new java.lang.StringBuilder;	 Catch:{ all -> 0x007e }
            r3.<init>();	 Catch:{ all -> 0x007e }
            r4 = "/proc/";
            r3.append(r4);	 Catch:{ all -> 0x007e }
            r4 = android.os.Process.myPid();	 Catch:{ all -> 0x007e }
            r3.append(r4);	 Catch:{ all -> 0x007e }
            r4 = "/cmdline";
            r3.append(r4);	 Catch:{ all -> 0x007e }
            r3 = r3.toString();	 Catch:{ all -> 0x007e }
            r2.<init>(r3);	 Catch:{ all -> 0x007e }
            r3 = "iso-8859-1";
            r1.<init>(r2, r3);	 Catch:{ all -> 0x007e }
            r0.<init>(r1);	 Catch:{ all -> 0x007e }
            r1 = new java.lang.StringBuilder;	 Catch:{ all -> 0x007c }
            r1.<init>();	 Catch:{ all -> 0x007c }
        L_0x0069:
            r2 = r0.read();	 Catch:{ all -> 0x007c }
            if (r2 <= 0) goto L_0x0074;
        L_0x006f:
            r2 = (char) r2;	 Catch:{ all -> 0x007c }
            r1.append(r2);	 Catch:{ all -> 0x007c }
            goto L_0x0069;
        L_0x0074:
            r5 = r1.toString();	 Catch:{ all -> 0x007c }
            r0.close();	 Catch:{ all -> 0x0084 }
            goto L_0x0084;
            goto L_0x007f;
        L_0x007e:
            r0 = r5;
        L_0x007f:
            if (r0 == 0) goto L_0x0084;
        L_0x0081:
            r0.close();	 Catch:{ all -> 0x0084 }
        L_0x0084:
            a = r5;
            if (r5 != 0) goto L_0x008a;
        L_0x0088:
            r5 = "";
        L_0x008a:
            return r5;
            */
            throw new UnsupportedOperationException("Method not decompiled: c.c.c.a.m$b.f(android.content.Context):java.lang.String");
        }

        public static Class<?> g(Context context) {
            if (c == null && !f) {
                try {
                    StringBuilder stringBuilder = new StringBuilder();
                    stringBuilder.append(context.getPackageName());
                    stringBuilder.append(".BuildConfig");
                    c = Class.forName(stringBuilder.toString());
                } catch (ClassNotFoundException unused) {
                }
                f = true;
            }
            return c;
        }
    }

    /* compiled from: Device */
    public class c {
        public static boolean a = false;

        /* JADX WARNING: Removed duplicated region for block: B:12:0x002c A:{SYNTHETIC, Splitter:B:12:0x002c} */
        public static java.lang.String a() {
            /*
            r0 = 0;
            r1 = java.lang.Runtime.getRuntime();	 Catch:{ all -> 0x0029 }
            r2 = "getprop ro.build.version.emui";
            r1 = r1.exec(r2);	 Catch:{ all -> 0x0029 }
            r2 = new java.io.BufferedReader;	 Catch:{ all -> 0x0029 }
            r3 = new java.io.InputStreamReader;	 Catch:{ all -> 0x0029 }
            r1 = r1.getInputStream();	 Catch:{ all -> 0x0029 }
            r3.<init>(r1);	 Catch:{ all -> 0x0029 }
            r1 = 1024; // 0x400 float:1.435E-42 double:5.06E-321;
            r2.<init>(r3, r1);	 Catch:{ all -> 0x0029 }
            r0 = r2.readLine();	 Catch:{ all -> 0x0026 }
            r2.close();	 Catch:{ all -> 0x0026 }
            r2.close();	 Catch:{ all -> 0x0030 }
            goto L_0x0030;
        L_0x0026:
            r1 = r0;
            r0 = r2;
            goto L_0x002a;
        L_0x0029:
            r1 = r0;
        L_0x002a:
            if (r0 == 0) goto L_0x002f;
        L_0x002c:
            r0.close();	 Catch:{ all -> 0x002f }
        L_0x002f:
            r0 = r1;
        L_0x0030:
            return r0;
            */
            throw new UnsupportedOperationException("Method not decompiled: c.c.c.a.m$c.a():java.lang.String");
        }

        /* JADX WARNING: Missing block: B:15:0x0039, code skipped:
            if (r0.toLowerCase(java.util.Locale.getDefault()).startsWith(r3) == false) goto L_0x003b;
     */
        /* JADX WARNING: Missing block: B:19:0x004f, code skipped:
            if (r0.toLowerCase(java.util.Locale.getDefault()).startsWith(r3) != false) goto L_0x0053;
     */
        public static boolean b(java.lang.String r4) {
            /*
            r0 = android.text.TextUtils.isEmpty(r4);
            if (r0 == 0) goto L_0x000a;
        L_0x0006:
            r4 = a();
        L_0x000a:
            r0 = android.text.TextUtils.isEmpty(r4);
            r1 = 1;
            if (r0 != 0) goto L_0x0022;
        L_0x0011:
            r0 = java.util.Locale.getDefault();
            r4 = r4.toLowerCase(r0);
            r0 = "emotionui";
            r4 = r4.startsWith(r0);
            if (r4 == 0) goto L_0x0022;
        L_0x0021:
            return r1;
        L_0x0022:
            r4 = 0;
            r0 = android.os.Build.BRAND;	 Catch:{ all -> 0x0052 }
            r2 = android.text.TextUtils.isEmpty(r0);	 Catch:{ all -> 0x0052 }
            r3 = "huawei";
            if (r2 != 0) goto L_0x003b;
        L_0x002d:
            r2 = java.util.Locale.getDefault();	 Catch:{ all -> 0x0052 }
            r0 = r0.toLowerCase(r2);	 Catch:{ all -> 0x0052 }
            r0 = r0.startsWith(r3);	 Catch:{ all -> 0x0052 }
            if (r0 != 0) goto L_0x0053;
        L_0x003b:
            r0 = android.os.Build.MANUFACTURER;	 Catch:{ all -> 0x0052 }
            r2 = android.text.TextUtils.isEmpty(r0);	 Catch:{ all -> 0x0052 }
            if (r2 != 0) goto L_0x0052;
        L_0x0043:
            r2 = java.util.Locale.getDefault();	 Catch:{ all -> 0x0052 }
            r0 = r0.toLowerCase(r2);	 Catch:{ all -> 0x0052 }
            r0 = r0.startsWith(r3);	 Catch:{ all -> 0x0052 }
            if (r0 == 0) goto L_0x0052;
        L_0x0051:
            goto L_0x0053;
        L_0x0052:
            r1 = 0;
        L_0x0053:
            return r1;
            */
            throw new UnsupportedOperationException("Method not decompiled: c.c.c.a.m$c.b(java.lang.String):boolean");
        }

        public static boolean c() {
            if (!a) {
                try {
                    Class.forName("miui.os.Build");
                    c.c.c.a.o.b.a = true;
                    a = true;
                    return true;
                } catch (Exception unused) {
                    a = true;
                }
            }
            return c.c.c.a.o.b.a;
        }

        public static boolean d() {
            return Build.DISPLAY.contains("Flyme") || Build.USER.equals("flyme");
        }
    }

    /* compiled from: Filters */
    public final class d {
        public static final Set<String> a;

        static {
            HashSet hashSet = new HashSet();
            a = hashSet;
            hashSet.add("HeapTaskDaemon");
            hashSet.add("ThreadPlus");
            hashSet.add("ApiDispatcher");
            hashSet.add("ApiLocalDispatcher");
            hashSet.add("AsyncLoader");
            hashSet.add("AsyncTask");
            hashSet.add("Binder");
            hashSet.add("PackageProcessor");
            hashSet.add("SettingsObserver");
            hashSet.add("WifiManager");
            hashSet.add("JavaBridge");
            hashSet.add("Compiler");
            hashSet.add("Signal Catcher");
            hashSet.add("GC");
            hashSet.add("ReferenceQueueDaemon");
            hashSet.add("FinalizerDaemon");
            hashSet.add("FinalizerWatchdogDaemon");
            hashSet.add("CookieSyncManager");
            hashSet.add("RefQueueWorker");
            hashSet.add("CleanupReference");
            hashSet.add("VideoManager");
            hashSet.add("DBHelper-AsyncOp");
            hashSet.add("InstalledAppTracker2");
            hashSet.add("AppData-AsyncOp");
            hashSet.add("IdleConnectionMonitor");
            hashSet.add("LogReaper");
            hashSet.add("ActionReaper");
            hashSet.add("Okio Watchdog");
            hashSet.add("CheckWaitingQueue");
            hashSet.add("NPTH-CrashTimer");
            hashSet.add("NPTH-JavaCallback");
            hashSet.add("NPTH-LocalParser");
            hashSet.add("ANR_FILE_MODIFY");
        }
    }

    /* compiled from: Net */
    public /* synthetic */ class e {
        public static final /* synthetic */ int[] a;

        /* JADX WARNING: Missing exception handler attribute for start block: B:5:0x0011 */
        /* JADX WARNING: Missing exception handler attribute for start block: B:11:0x001b */
        /* JADX WARNING: Missing exception handler attribute for start block: B:3:0x000c */
        /* JADX WARNING: Failed to process nested try/catch */
        /* JADX WARNING: Failed to process nested try/catch */
        /* JADX WARNING: Can't wrap try/catch for region: R(13:0|1|2|3|4|5|6|7|9|10|11|12|14) */
        /* JADX WARNING: Can't wrap try/catch for region: R(12:0|1|2|3|4|(2:5|6)|7|9|10|11|12|14) */
        /* JADX WARNING: Missing block: B:15:?, code skipped:
            return;
     */
        static {
            /*
            c.c.c.a.o.b.b.values();
            r0 = 6;
            r0 = new int[r0];
            a = r0;
            r1 = 1;
            r2 = 4;
            r0[r2] = r1;	 Catch:{ NoSuchFieldError -> 0x000c }
        L_0x000c:
            r0 = a;	 Catch:{ NoSuchFieldError -> 0x0011 }
            r3 = 2;
            r0[r3] = r3;	 Catch:{ NoSuchFieldError -> 0x0011 }
        L_0x0011:
            r0 = a;	 Catch:{ NoSuchFieldError -> 0x0016 }
            r3 = 3;
            r0[r3] = r3;	 Catch:{ NoSuchFieldError -> 0x0016 }
        L_0x0016:
            r0 = 5;
            r3 = a;	 Catch:{ NoSuchFieldError -> 0x001b }
            r3[r0] = r2;	 Catch:{ NoSuchFieldError -> 0x001b }
        L_0x001b:
            r2 = a;	 Catch:{ NoSuchFieldError -> 0x001f }
            r2[r1] = r0;	 Catch:{ NoSuchFieldError -> 0x001f }
        L_0x001f:
            return;
            */
            throw new UnsupportedOperationException("Method not decompiled: c.c.c.a.m$e.m1090clinit():void");
        }
    }

    /* compiled from: PackUtil */
    public final class f {
        /* JADX WARNING: Removed duplicated region for block: B:11:0x002e A:{SYNTHETIC, Splitter:B:11:0x002e} */
        public static void a(c.c.c.a.e.a r7, c.c.c.a.e.b r8, c.c.c.a.f r9) {
            /*
            r0 = "_";
            r7 = r7.a;
            if (r7 == 0) goto L_0x008e;
        L_0x0006:
            if (r9 != 0) goto L_0x000a;
        L_0x0008:
            goto L_0x008e;
        L_0x000a:
            r1 = "crash_time";
            r1 = r7.optLong(r1);
            r7 = c.c.c.a.n.c;
            if (r7 == 0) goto L_0x0025;
        L_0x0014:
            r7 = r7.a();
            r3 = "aid";
            r7 = r7.get(r3);
            r3 = r7 instanceof java.lang.String;
            if (r3 == 0) goto L_0x0025;
        L_0x0022:
            r7 = (java.lang.String) r7;
            goto L_0x0026;
        L_0x0025:
            r7 = 0;
        L_0x0026:
            r3 = android.text.TextUtils.isEmpty(r7);
            r4 = 0;
            if (r3 == 0) goto L_0x002e;
        L_0x002d:
            goto L_0x0037;
        L_0x002e:
            r4 = java.lang.Integer.parseInt(r7);	 Catch:{ NumberFormatException -> 0x0033 }
            goto L_0x0037;
        L_0x0033:
            r7 = c.c.c.a.n.a;
            r7 = c.c.c.a.n.d;
        L_0x0037:
            r7 = c.c.c.a.n.a();
            r7 = r7.a();
            r5 = 0;
            r3 = (r1 > r5 ? 1 : (r1 == r5 ? 0 : -1));
            if (r3 <= 0) goto L_0x008e;
        L_0x0045:
            if (r4 <= 0) goto L_0x008e;
        L_0x0047:
            r3 = android.text.TextUtils.isEmpty(r7);
            if (r3 != 0) goto L_0x008e;
        L_0x004d:
            r3 = "0";
            r3 = r3.equals(r7);
            if (r3 != 0) goto L_0x008e;
        L_0x0055:
            r3 = r9.a;
            r3 = android.text.TextUtils.isEmpty(r3);
            if (r3 != 0) goto L_0x008e;
        L_0x005d:
            r3 = new java.lang.StringBuilder;	 Catch:{ JSONException -> 0x008a }
            r3.<init>();	 Catch:{ JSONException -> 0x008a }
            r5 = "android_";
            r3.append(r5);	 Catch:{ JSONException -> 0x008a }
            r3.append(r4);	 Catch:{ JSONException -> 0x008a }
            r3.append(r0);	 Catch:{ JSONException -> 0x008a }
            r3.append(r7);	 Catch:{ JSONException -> 0x008a }
            r3.append(r0);	 Catch:{ JSONException -> 0x008a }
            r3.append(r1);	 Catch:{ JSONException -> 0x008a }
            r3.append(r0);	 Catch:{ JSONException -> 0x008a }
            r3.append(r9);	 Catch:{ JSONException -> 0x008a }
            r7 = r3.toString();	 Catch:{ JSONException -> 0x008a }
            r9 = "unique_key";
            r8 = r8.b;	 Catch:{ JSONException -> 0x008a }
            if (r8 == 0) goto L_0x008e;
        L_0x0086:
            r8.put(r9, r7);	 Catch:{ JSONException -> 0x008a }
            goto L_0x008e;
        L_0x008a:
            r7 = move-exception;
            r7.printStackTrace();
        L_0x008e:
            return;
            */
            throw new UnsupportedOperationException("Method not decompiled: c.c.c.a.m$f.a(c.c.c.a.e.a, c.c.c.a.e.b, c.c.c.a.f):void");
        }
    }

    /* compiled from: RomUtils */
    public class g {
        public static String a() {
            CharSequence charSequence = "";
            String str = "_";
            StringBuilder g;
            String stringBuilder;
            String str2;
            if (c.c()) {
                if (c.c()) {
                    g = c.b.a.a.a.g("miui_");
                    g.append(b("ro.miui.ui.version.name"));
                    g.append(str);
                    g.append(VERSION.INCREMENTAL);
                    stringBuilder = g.toString();
                }
                return stringBuilder;
            } else if (c.d()) {
                str2 = Build.DISPLAY;
                if (str2 != null && str2.toLowerCase(Locale.getDefault()).contains("flyme")) {
                    stringBuilder = str2;
                }
                return stringBuilder;
            } else if (c()) {
                if (c()) {
                    g = c.b.a.a.a.g("coloros_");
                    g.append(b("ro.build.version.opporom"));
                    g.append(str);
                    g.append(Build.DISPLAY);
                    stringBuilder = g.toString();
                }
                return stringBuilder;
            } else {
                CharSequence charSequence2;
                str2 = c.a();
                if (str2 == null || !str2.toLowerCase(Locale.getDefault()).contains("emotionui")) {
                    charSequence2 = charSequence;
                } else {
                    g = c.b.a.a.a.i(str2, str);
                    g.append(Build.DISPLAY);
                    charSequence2 = g.toString();
                }
                if (!TextUtils.isEmpty(charSequence2)) {
                    return charSequence2;
                }
                str2 = "ro.vivo.os.build.display.id";
                String b = b(str2);
                Object obj = null;
                Object obj2 = (TextUtils.isEmpty(b) || !b.toLowerCase(Locale.getDefault()).contains("funtouch")) ? null : 1;
                StringBuilder stringBuilder2;
                if (obj2 != null) {
                    stringBuilder2 = new StringBuilder();
                    stringBuilder2.append(b(str2));
                    stringBuilder2.append(str);
                    stringBuilder2.append(b("ro.vivo.product.version"));
                    return stringBuilder2.toString();
                }
                str2 = Build.DISPLAY;
                obj2 = (TextUtils.isEmpty(str2) || !str2.toLowerCase(Locale.getDefault()).contains("amigo")) ? null : 1;
                if (obj2 != null) {
                    g = c.b.a.a.a.i(str2, str);
                    g.append(b("ro.gn.sv.version"));
                    return g.toString();
                }
                StringBuilder stringBuilder3 = new StringBuilder();
                stringBuilder3.append(Build.MANUFACTURER);
                stringBuilder3.append(Build.BRAND);
                b = stringBuilder3.toString();
                if (!TextUtils.isEmpty(b)) {
                    b = b.toLowerCase(Locale.getDefault());
                    if (b.contains("360") || b.contains("qiku")) {
                        obj = 1;
                    }
                }
                if (obj != null) {
                    stringBuilder2 = new StringBuilder();
                    stringBuilder2.append(b("ro.build.uiversion"));
                    stringBuilder2.append(str);
                    stringBuilder2.append(str2);
                    return stringBuilder2.toString();
                }
                b = "ro.letv.release.version";
                if ((TextUtils.isEmpty(b(b)) ^ 1) != 0) {
                    stringBuilder2 = c.b.a.a.a.g("eui_");
                    stringBuilder2.append(b(b));
                    stringBuilder2.append(str);
                    stringBuilder2.append(str2);
                    charSequence = stringBuilder2.toString();
                }
                return !TextUtils.isEmpty(charSequence) ? charSequence : str2;
            }
        }

        /* JADX WARNING: Removed duplicated region for block: B:13:0x003b A:{SYNTHETIC, Splitter:B:13:0x003b} */
        public static java.lang.String b(java.lang.String r4) {
            /*
            r0 = "";
            r1 = java.lang.Runtime.getRuntime();	 Catch:{ all -> 0x0038 }
            r2 = new java.lang.StringBuilder;	 Catch:{ all -> 0x0038 }
            r2.<init>();	 Catch:{ all -> 0x0038 }
            r3 = "getprop ";
            r2.append(r3);	 Catch:{ all -> 0x0038 }
            r2.append(r4);	 Catch:{ all -> 0x0038 }
            r4 = r2.toString();	 Catch:{ all -> 0x0038 }
            r4 = r1.exec(r4);	 Catch:{ all -> 0x0038 }
            r1 = new java.io.BufferedReader;	 Catch:{ all -> 0x0038 }
            r2 = new java.io.InputStreamReader;	 Catch:{ all -> 0x0038 }
            r3 = r4.getInputStream();	 Catch:{ all -> 0x0038 }
            r2.<init>(r3);	 Catch:{ all -> 0x0038 }
            r3 = 1024; // 0x400 float:1.435E-42 double:5.06E-321;
            r1.<init>(r2, r3);	 Catch:{ all -> 0x0038 }
            r0 = r1.readLine();	 Catch:{ all -> 0x0036 }
            r4.destroy();	 Catch:{ all -> 0x0036 }
            r1.close();	 Catch:{ all -> 0x0035 }
        L_0x0035:
            return r0;
            goto L_0x0039;
        L_0x0038:
            r1 = 0;
        L_0x0039:
            if (r1 == 0) goto L_0x003e;
        L_0x003b:
            r1.close();	 Catch:{ all -> 0x003e }
        L_0x003e:
            return r0;
            */
            throw new UnsupportedOperationException("Method not decompiled: c.c.c.a.m$g.b(java.lang.String):java.lang.String");
        }

        public static boolean c() {
            String str = Build.MANUFACTURER;
            return !TextUtils.isEmpty(str) ? str.toLowerCase(Locale.getDefault()).contains("oppo") : false;
        }
    }

    /* compiled from: Stack */
    public class h {
        public final PrintWriter a;

        public h(PrintWriter printWriter) {
            this.a = printWriter;
        }
    }

    public static synchronized void a(Context context, h hVar, boolean z, boolean z2, boolean z3, boolean z4) {
        synchronized (m.class) {
            if (a) {
            } else if (context == null) {
                throw new IllegalArgumentException("context must be not null.");
            } else if (hVar != null) {
                if (!(context instanceof Application)) {
                    context = context.getApplicationContext();
                }
                if (b.e(context)) {
                    return;
                }
                Context context2 = n.a;
                n.b = System.currentTimeMillis();
                n.a = context;
                n.c = new c.c.c.a.i.b(context, hVar);
                if (c.c.c.a.i.a.e.e == null) {
                    c.c.c.a.i.a.e.e = new c.c.c.a.i.a.e(context);
                }
                if (z || z2) {
                    if (c.c.c.a.g.b.e == null) {
                        c.c.c.a.g.b.e = new c.c.c.a.g.b();
                    }
                    c.c.c.a.g.b bVar = c.c.c.a.g.b.e;
                    if (z) {
                        bVar.c = new c.c.c.a.g.c(context);
                    }
                }
                a = true;
                j.b().post(new a(context, z4));
            } else {
                throw new IllegalArgumentException("params must be not null.");
            }
        }
    }
}
